package com.example.restful01.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.restful01.model.Register;
import com.example.restful01.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RegisterMapper extends BaseMapper<Register> {
    @Select("SELECT u.*\n" +
            "FROM register r\n" +
            "JOIN user u ON r.phone = u.reader_phone\n" +
            "WHERE r.phone = #{phone} AND r.password = #{password} AND r.is_admin = #{isAdmin};\n")
    User isFind(Register register);
}
